package com.zw.test.jdk15;


/*
 * 指定允许的子类
 * 只希望Cat和Dog作为Animal的子类
 * */
public sealed class Animal permits Cat, Dog {

    public void eat() {
        System.out.println("eat");
    }

}
